
function loadSelect(typeCode, positionId, selectName, selectedId) {
	var $select = $("<select name='"+selectName+"'></select>");
	$select.append($("<option value=''>--请选择--</option>"));
	
	$.post("${pageContext.request.contextPath}/BaseDictAction", {dict_type_code: typeCode}, 
		function(data) {
			$.each(data, function(i, json) {
				var $option = $("<option value='"+json['dict_id']+"'>"+json['dict_item_name']+"</option>");
				if(json['dict_id'] == selectedId) {
					$option.attr("selected","selected");
				}
				$select.append($option);
			});
	}, "json");
	
	$("#"+positionId).append($select);
}

function openWindow(url, name, width, height) {
	var top = (window.screen.height-30-height)/2;
	var left = (window.screen.width-10-width)/2;
	window.open(url, name, "width="+width+",height="+height+",left="+left+",top="+top+",location=no,menubar=no,resizable=no,scrollbars=auto,status=no,toolbar=no");
}